import './assets/main.css'
import 'amfe-flexible'

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

//底部导航
// import { Tabbar, TabbarItem } from 'vant'
// import { Overlay } from 'vant'
// import { Toast } from 'vant'
// import { Image as VanImage } from 'vant'
// import { Col, Row } from 'vant'
// import { Dialog } from 'vant'
import Vant from 'vant'
import 'vant/lib/index.css' // 确保引入了样式文件

import { Toast } from 'vant'

//公用方法
import { myGlobalMethod } from './utils/function'
import { getToken, setToken, removeToken } from './utils/cookieutil'

const app = createApp(App)

app.use(createPinia())
app.use(router)

// 将 Toast 方法挂载到 Vue 的原型上
app.config.globalProperties.$toast = Toast

app.use(Vant)

// app.use(Tabbar)
// app.use(TabbarItem)
// app.use(Overlay)
// app.use(Toast)
// app.use(VanImage)
// app.use(Col)
// app.use(Row)
// app.use(Dialog)

//注册公用方法
app.config.globalProperties.$myGlobalMethod = myGlobalMethod
app.config.globalProperties.$setToken = setToken
app.config.globalProperties.$getToken = getToken
app.config.globalProperties.$removeToken = removeToken

app.mount('#app')
